package config

// Config 配置结构
type Config struct {
	MySQL         MySQLConfig         `mapstructure:"mysql"`
	Redis         RedisConfig         `mapstructure:"redis"`
	Elasticsearch ElasticsearchConfig `mapstructure:"elasticsearch"`
	GRPC          GRPCConfig          `mapstructure:"grpc"`
	Server        ServerConfig        `mapstructure:"server"`
}

// MySQLConfig MySQL配置
type MySQLConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	DBName   string `mapstructure:"dbname"`
}

// RedisConfig Redis配置
type RedisConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Password string `mapstructure:"password"`
	Database int    `mapstructure:"database"`
}

// ElasticsearchConfig Elasticsearch配置
type ElasticsearchConfig struct {
	Address string `mapstructure:"address"`
}

// GRPCConfig gRPC配置
type GRPCConfig struct {
	Port int `mapstructure:"port"`
}

// ServerConfig 服务配置
type ServerConfig struct {
	Name    string `mapstructure:"name"`
	Version string `mapstructure:"version"`
}

